﻿#ifndef _CPROPERTYSET_H_H_
#define _CPROPERTYSET_H_H_

#include "udatabase/dll_cfg.h"
#include "udatabase/interface/ipropertyset.h"



namespace FD{
	namespace Utility{
		namespace DB{
				///<summary>
				///键值对类
				///</summary>
				class FD_DB_Export CPropertySet
					: public FD::Utility::DB::Interface::IPropertySet
				{
				public:
					/// <summary>
					/// 构造函数
					/// </summary>
					/// <param name=""></param>
					/// <returns></returns>
					CPropertySet();
					/// <summary>
					/// 析构函数
					/// </summary>
					/// <param name=""></param>
					/// <returns></returns>
					virtual ~CPropertySet();

				public:
					/// <summary>
					/// 获取键值对的个数
					/// </summary>
					/// <param name=""></param>
					/// <returns>键值对的个数</returns>
                    virtual UINT32 getCount() const;
					/// <summary>
					/// 是否存在键值
					/// </summary>
					/// <param name="key">键值对标示</param>
					/// <returns>存在返回true,否则返回false</returns>
                    virtual bool exist(const String& key)const;
					/// <summary>
					/// 获取索引位置的键值标示
					/// </summary>
					/// <param name="index">索引号</param>
					/// <returns>键值标示</returns>
                    virtual String getKey(UINT32 index)const;  
					/// <summary>
					/// 设置键值属性
					/// </summary>
					/// <param name="key">键值标示</param>
					/// <param name="value">键值</param>
					/// <returns></returns>
                    virtual void setProperty(const String& key,  const FD::Kernel::Variant& value);
					/// <summary>
					/// 获取键值属性
					/// </summary>
					/// <param name="key">键值标示</param>
					/// <returns>键值</returns>
                    virtual const FD::Kernel::Variant& getProperty(const String& key) const;  
					/// <summary>
					/// 删除键值key处的键值对
					/// </summary>
					/// <param name="key">键值标示</param>
					/// <returns></returns>
                    virtual void remove(const String& key);
					/// <summary>
					/// 删除所有的值
					/// </summary>
					/// <param name=""></param>
					/// <returns></returns>
                    virtual void clear();
					/// <summary>
					/// 深度拷贝
					/// </summary>
					/// <param name=""></param>
					/// <returns>新的键值对类对象</returns>
                    virtual FD::Utility::DB::Interface::IPropertySet* clone()const;
				protected:
					std::map<String, FD::Kernel::Variant> mPropertySet;
				};
			}
		}
	}

#endif
